package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpContractsChangeRenewalsPageUtil extends SeleniumPageUtil {
	
	public final static By CCR_SPAN_ACTION			= By.id("ContractChgRequestsDashboard1_lblActions");
	public final static By CCR_TD_USER_SELECT			= By.id("ContractChgRequestsDashboard1_tdUserSelect");
	public final static By CCR_INPUT_USER				= By.id("ContractChgRequestsDashboard1_txtUser");
	public final static By CCR_DIV_RESULT_PAGE		= By.xpath("//*[@id='ContractChgRequestsDashboard1_lblPaging']/div");
	public final static By CCR_TD_CONTRACTS			= By.xpath("//*[@id='pnlChgReq']/table/tbody/tr/td[5]");
	public final static By CCR_SPAN_REC_NUM			= By.id("ContractChgRequestsDashboard1_lblNumRecs");
	public final static By CCR_SPAN_SCOPE				= By.id("ContractChgRequestsDashboard1_lblScope");
	
	public final static By CCR_FILTER_IN_RENEWAL		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[2]/div/img[1]");
	public final static By CCR_FILTER_CUSTOMER		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[6]/div/img[1]");
	public final static By CCR_FILTER_CONTRACT_ID		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[7]/div/img[1]");
	public final static By CCR_FILTER_SALES_REP		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[9]/div/img[1]");
	public final static By CCR_FILTER_BILL_CYCLE		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[11]/div/img[1]");
	public final static By CCR_FILTER_PO_NUM		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[12]/div/img[1]");
	public final static By CCR_FILTER_PARTNER		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[13]/div/img[1]");
	public final static By CCR_FILTER_START		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[14]/div/img[1]");
	public final static By CCR_FILTER_STOP		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[15]/div/img[1]");
	public final static By CCR_FILTER_END_DATE		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[16]/div/img[1]");
	
	public final static By CCR_LINK_IN_RENEWAL		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[2]/a");
	public final static By CCR_LINK_CUSTOMER					= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[6]/a");
	public final static By CCR_LINK_CONTRACT_ID		= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[7]/a");
	public final static By CCR_LINK_REV					= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[8]/a");
	public final static By CCR_LINK_SALES_REP					= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[9]/a");
	public final static By CCR_LINK_LINES			= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[10]/a");
	public final static By CCR_LINK_BILL_CYCLE				= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[11]/a");
	public final static By CCR_LINK_PO_NUM			= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[12]/a");
	public final static By CCR_LINK_PARTNER			= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[13]/a");
	public final static By CCR_LINK_START			= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[14]/a");
	public final static By CCR_LINK_STOP				= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[15]/a");
	public final static By CCR_LINK_END_DATE				= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[16]/a");
	public final static By CCR_LINK_COMMENTS				= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[17]/a");
	public final static By CCR_LINK_DISC_PCT1				= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[18]/a");
	public final static By CCR_LINK_DISC_PCT2				= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[19]/a");
	public final static By CCR_LINK_DISC_PCT3				= By.xpath("//*[@id='ContractChgRequestsDashboard1_ajaxTblHdr']/tbody/tr[1]/td[20]/a");
	public static void enter(){
		SpContractsChangePageUtil.enterChangesRenewals();
		waitForPageToLoad();
	}

	private static void waitForPageToLoad() {
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{
				CCR_INPUT_USER,CCR_LINK_IN_RENEWAL,CCR_LINK_DISC_PCT3
		});
	}
}
